function activeContent(id){
	jQuery.ajax({
	  url: '/admin/activeContent/' + id,
	  success: function(rs) {
		  if(rs == "true"){
			  divActive = ".active_" + id;
			  divDeActive = ".deactive_" + id;
			  jQuery(divActive).show();
			  jQuery(divDeActive).hide();
			  alertSuccessActionContent(id, "Actived");
		  }				  
	  }
	});
}
		
function deActiveContent(id){
	jQuery.ajax({
	  url: '/admin/deActiveContent/' + id,
	  success: function(rs) {
		  if(rs == "true"){
			  divActive = ".active_" + id;
			  divDeActive = ".deactive_" + id;
			  jQuery(divActive).hide();
			  jQuery(divDeActive).show();
			  alertSuccessActionContent(id, "Deactived");
		   }
	  }
	});
}

function deleteContent(id){
	jQuery.ajax({
		  url: '/admin/deleteContent/' + id,
		  success: function(rs) {
			  if(rs == "true"){
				  divContent = ".content_" + id;
				  jQuery(divContent).hide();
				  alertSuccessActionContent(id, "Deleted");
			   }
		  }
		});
}

function alertSuccessActionContent(id, info){
	html ="<tbody><tr><td class='yellow-left'>You " + info + " Content Id " + id + " Success</td>" + 
	"<td class='yellow-right'><a class='close-yellow'></a></td></tr></tbody>";
	jQuery("#message-yellow table").html(html);	
	closeLightBox();
}

function viewLightBox(alias, info, action, id){
	jQuery("#modal-from-dom").modal({
		show: true, 
		backdrop: 'static',
		keyboard: true
	})
	actionValue = action + "(" + id + ")";
	header = "<a href='#' class='close'>&times;</a><h3>Manager Content</h3>";
	body = "<p>You want " + info + " Content " + alias + "</p>";
	footer = "<a href='#' onclick='closeLightBox()' class='btn secondary'>Close</a>" + "<a href='#'onclick='" + actionValue + "' class='btn primary'>Submit</a>";
	jQuery("#modal-from-dom .modal-header").html(header);
	jQuery("#modal-from-dom .modal-body").html(body);
	jQuery("#modal-from-dom .modal-footer").html(footer);
	return true;
}

function closeLightBox(){
	jQuery("#modal-from-dom").modal('hide');
}

function deleteFollowContent(id){
	jQuery.ajax({
		  url: '/xoa-bai-theo-doi/' + id,
		  success: function(rs) {
			  if(rs == "true"){
				  jQuery(".followContent_" + id).hide();
				  closeLightBox();
			  }else{
				  jQuery(".followContent_" + id).show();
			  }				  
		  }
	});	
}

function userDeleteContent(id){
	jQuery.ajax({
		  url: '/content/deleteContent/' + id,
		  success: function(rs) {
			  if(rs == "true"){
				  divContent = ".content_" + id;
				  jQuery(divContent).hide();
			   }
			  closeLightBox();
		  }
		});
}